Add xremap module integration with home-manager - #768
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughWalkthroughThe pull request modifies Hyprland keybinding configuration, restructures key remapping services in a host configuration, and adds a new xremap Home Manager module for desktop Linux systems. Changes include adjusting Hyprland's mod+Shift+F binding, importing xremap modules, creating a new xremap service configuration with Ghostty-specific overrides, and reorganizing Keyd service configuration. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's input remapping capabilities by integrating the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Mesa DescriptionTL;DRAdd a reusable Home Manager xremap module and move input remapping from host config to user scope. Clarifies key mapping and restores Hyprland $mod+Shift+F togglefloating. What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request effectively introduces xremap integration with home-manager by creating a dedicated module. This refactoring moves the configuration from a host-specific file to a reusable module, which is a significant improvement for maintainability and modularity. The changes are well-structured and align with the goal of enhancing input remapping capabilities. I have one suggestion to make the code in the new module more concise.
| letters = [ | ||
| "a" | ||
| "b" | ||
| "c" | ||
| "d" | ||
| "e" | ||
| "f" | ||
| "g" | ||
| "h" | ||
| "i" | ||
| "j" | ||
| "k" | ||
| "l" | ||
| "m" | ||
| "n" | ||
| "o" | ||
| "p" | ||
| "q" | ||
| "r" | ||
| "s" | ||
| "t" | ||
| "u" | ||
| "v" | ||
| "w" | ||
| "x" | ||
| "y" | ||
| "z" | ||
| ]; |
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="named-hosts/matic/default.nix">
<violation number="1" location="named-hosts/matic/default.nix:74">
P2: This configuration duplicates the existing `config/keyd/default.nix` module. Instead of inlining the configuration, restore the `../../config/keyd` import to the `modules` list to maintain a Single Source of Truth and reduce clutter.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| security.sudo.wheelNeedsPassword = false; | ||
|
|
||
| # Keyd configuration (Linux desktop only) | ||
| services.keyd.enable = true; |
There was a problem hiding this comment.
P2: This configuration duplicates the existing config/keyd/default.nix module. Instead of inlining the configuration, restore the ../../config/keyd import to the modules list to maintain a Single Source of Truth and reduce clutter.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At named-hosts/matic/default.nix, line 74:
<comment>This configuration duplicates the existing `config/keyd/default.nix` module. Instead of inlining the configuration, restore the `../../config/keyd` import to the `modules` list to maintain a Single Source of Truth and reduce clutter.</comment>
<file context>
@@ -76,127 +70,25 @@ inputs.nixpkgs.lib.nixosSystem {
security.sudo.wheelNeedsPassword = false;
+ # Keyd configuration (Linux desktop only)
+ services.keyd.enable = true;
+ users.groups.keyd = { };
+ systemd.services.keyd.serviceConfig = {
</file context>
There was a problem hiding this comment.
Pull request overview
This PR introduces xremap as a Home Manager module (backed by the upstream xremap/nix-flake Home Manager module) and updates the matic NixOS host configuration accordingly, while adjusting a Hyprland keybinding to align with the new remapping approach.
Changes:
- Move xremap configuration out of the
maticNixOS host module into a dedicated Home Manager module (home-manager/modules/xremap). - Integrate the upstream
inputs.xremap.homeManagerModules.defaultmodule into the Home Manager import set. - Update
maticto configure keyd directly (and drop the prior module import), and tweak a Hyprland window-management binding.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
named-hosts/matic/default.nix |
Removes direct xremap NixOS module usage; adds inline keyd configuration and keeps uinput/udev rules needed for input remapping. |
home-manager/modules/xremap/default.nix |
New Home Manager module that defines xremap keymaps and a small systemd user-service tweak for desktop Linux. |
home-manager/modules/default.nix |
Registers the new local ./xremap module. |
home-manager/default.nix |
Imports upstream inputs.xremap.homeManagerModules.default so services.xremap is available in HM. |
config/hyprland/hyprland.conf |
Adjusts an F binding in the window-management section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Keyd configuration (Linux desktop only) | ||
| services.keyd.enable = true; | ||
| users.groups.keyd = { }; | ||
| systemd.services.keyd.serviceConfig = { | ||
| CapabilityBoundingSet = [ "CAP_SETGID" ]; | ||
| AmbientCapabilities = [ "CAP_SETGID" ]; | ||
| }; | ||
| systemd.services.keyd.restartTriggers = [ | ||
| (builtins.hashFile "sha256" ../../config/keyd/default.conf) | ||
| ]; | ||
| environment.etc."keyd/default.conf".source = ../../config/keyd/default.conf; |
There was a problem hiding this comment.
The keyd configuration here duplicates the existing config/keyd/default.nix module (same enable/group/capabilities/restartTriggers/etc). Consider importing ../../config/keyd again (or reusing that module) instead of inlining, to reduce duplication and avoid future drift.
| bind = $mod SHIFT, F, togglefloating, | ||
| bind = CTRL ALT SHIFT SUPER, F, exec, hyprctl --batch "dispatch movetoworkspace empty; dispatch fullscreen 0" | ||
| bind = $mod SHIFT, F, exec, hyprctl --batch "dispatch movetoworkspace empty; dispatch fullscreen 0" | ||
| bind = SUPER CTRL, F, fullscreen, 0 |
There was a problem hiding this comment.
This change removes the only togglefloating keybinding in the Hyprland config (no other togglefloating bind exists in repo config). If floating toggle is still desired, consider reintroducing it on a different chord so the action remains accessible.
| bind = SUPER CTRL, F, fullscreen, 0 | |
| bind = SUPER CTRL, F, fullscreen, 0 | |
| bind = $mod, G, togglefloating, |
Clarify SUPER vs Hyper key pipeline in keyd comments and revert incorrect hyprland bind change (restore togglefloating on $mod+Shift+F).
Framework+F now passes through as Hyper+F to Hyprland instead of being remapped to Ctrl+F by xremap.
Introduce the xremap module and integrate it with home-manager to enable input remapping features. Adjustments to key bindings and service configurations enhance user experience on Linux desktops.
Summary by cubic
Add a reusable Home Manager xremap module and move input remapping from host config to user scope. Enables macOS-style shortcuts via Hyper→Ctrl, with Ghostty overrides and Hyprland-safe exceptions; restores $mod+Shift+F togglefloating and keeps fullscreen on Hyper+F.
New Features
Refactors
Written for commit 500cf20. Summary will update on new commits.